<template>
  <div>
    <div class="container">
      <div class="">
        <li>地址：{{ params.ADDRESS }}</li>
        <li>公司名称：{{ params.COMP_NAME }}</li>
        <li>企业ID：{{ params.UID }}</li>
        <li>联系人：{{ params.LEGAL_PERSON }}</li>
      </div>
      <div id="myChart" style="height: 500px"></div>
    </div>
  </div>
</template>

<script>
export default {
  layout: "default",
  data() {
    return {};
  },
  head() {
    return {
      title: this.title,
      meta: [
        {
          hid: "description",
          name: "description",
          content: "My custom description",
        },
      ],
    };
  },
  async asyncData({ params }) {
    console.log("params", params);

    console.log(params.info);
    return {params}
  },
  methods: {
    echartsInit() {
      var that = this;
      console.log("this.$echarts", that.$echarts);
      // 找到容器
      let myChart =
        that.$echarts && that.$echarts.init(document.getElementById("myChart"));
      // 开始渲染
      myChart &&
        myChart.setOption({
          title: { text: "在Vue中使用echarts" },
          tooltip: {},
          xAxis: {
            data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
          },
          yAxis: {},
          series: [
            {
              name: "销量",
              type: "bar",
              data: [5, 20, 36, 10, 10, 20],
            },
          ],
        });
    },
  },
  mounted() {
    this.echartsInit();
  },
};
</script>

<style scoped>
</style>
